package com.sumainfor.pc.gmio.controller.tenant;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.impl.tenant.TenantKeepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/4/6 20:48
 * @Description:
 */
@RestController
@RequestMapping("/tenant/key/keep")
public class TenantKeepController {

    @Autowired
    TenantKeepService TenantKeepService;

    /**
     * 功能描述: 
     * 获取管家评价的分类集合
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/4/6 20:50
     */
    @GetMapping("/getEvaluateList")
    public JsonResult getEvaluateList(){
        JsonResult result=new JsonResult();
        return result.put(TenantKeepService.getEvaluateList());
    }

    /**
     * 功能描述: 
     * 租客联系管家记录
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/4/6 20:52
     */
    @PostMapping("/AddTenantCallKeep")
    public JsonResult AddTenantCallKeep(@RequestBody Map<String,Object> params){
        JsonResult result=new JsonResult();
        if(TenantKeepService.AddTenantCallKeep(params)){
            result.putSuccess("保存成功！");
        }else{
            result.putSuccess("服务器繁忙，请稍后重试！");
        }
        return result;
    }

    /**
     * 功能描述: 
     * 租客对管家评价
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/4/6 20:54
     */
    @PostMapping("/AddTenantEvaKeep")
    public JsonResult AddTenantEvaKeep(@RequestBody Map<String,Object>params){
        JsonResult result=new JsonResult();
        if(TenantKeepService.AddTenantEvaKeep(params)){
            result.putSuccess("保存成功！");
        }else{
            result.putSuccess("服务器繁忙，请稍后重试！");
        }
        return result;
    }

}
